package com.zwps.biz.api.model.dto.user;

import java.util.Set;
import javax.validation.constraints.Email;
import javax.validation.constraints.Size;
import org.hibernate.validator.constraints.Length;

import com.zwps.biz.api.enums.UserIdentityEnum;
import com.zwps.biz.api.enums.UserSexEnum;
import com.zwps.biz.api.enums.UserStatusEnum;
import com.zwps.common.api.validator.EnumOption;
import com.zwps.common.api.validator.Phone;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

@Schema(description = "修改用户")
@Getter
@Setter
@ToString
public class UpdateUserDTO {

    /**
     * 真实姓名
     */
    @Schema(description = "真实姓名")
    @Length(max = 30)
    private String realname;

    /**
     * 密码
     */
    @Schema(description = "旧密码，密码必须包含大小写字母、数字、特殊符号，且长度为8~16（AES加密）")
//    @Length(max = 100)
    private String oldPassword;

    @Schema(description = "原密码，一旦这个字符长度大于0表示修改密码，旧密码和确认密码字段都必须存在值，密码必须包含大小写字母、数字、特殊符号，且长度为8~16（AES加密）")
//    @Length(max = 100)
    private String newPassword;

    /**
     * 确认密码
     */
    @Schema(description = "确认密码，密码必须包含大小写字母、数字、特殊符号，且长度为8~16（AES加密）")
//    @Length(max = 100)
    private String confirmPassword;

    /**
     * 性别
     */
    @Schema(description = "性别，选项【0：未知|1：男|2：女】", example = "0")
    @EnumOption(UserSexEnum.class)
    private Integer sex;

    /**
     * 电子邮件
     */
    @Schema(description = "电子邮件")
    @Email
    private String email;

    /**
     * 手机号码
     */
    @Schema(description = "手机号码")
    @Phone
    private String phone;

    /**
     * 账号状态
     */
    @Schema(description = "账号状态，选项【0：正常|1：冻结】")
    @EnumOption(UserStatusEnum.class)
    private Integer status;

    /**
     * 账号身份标识
     */
    @Schema(description = "账号身份标识，选项【0：成员|1：管理员】")
    @EnumOption(UserIdentityEnum.class)
    private Integer userIdentity;

    /**
     * 部门ID
     */
    @Schema(description = "部门ID")
    private String deptId;

    /**
     * 角色ID列表
     */
    @Schema(description = "角色ID列表")
    @Size(max = 999)
    private Set<String> roleIds;

    /**
     * 职务
     */
    @Schema(description = "职务")
    private String duties;

}
